<div class="modal" ng-controller="DuplicateAppCtrl">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header"><h2>{{'APP.POPUP.DUPLICATE-TITLE' | translate}}</h2></div>
      <div class="modal-body">
        <div class="alert error" ng-if="model.errorMessage && model.errorMessage.length > 0"
             style="font-size: 14px; margin-top:20px">
          <div class="popup-error" style="font-size: 14px">
            <span class="glyphicon glyphicon-remove-circle"></span>
            <span>{{model.errorMessage}}</span>
          </div>
        </div>
        <p>{{originalModel?'APP.POPUP.DUPLICATE-DESCRIPTION':'APP.POPUP.CREATE-DESCRIPTION' | translate}}</p>
        <div class="form-group">
          <label for="newAppName">{{'APP.NAME' | translate}}</label>
          <input auto-focus class="form-control" custom-keys
                 enter-pressed="ok()" id="newAppName"
                 ng-disabled="model.loading" ng-model="model.app.name" type="text">
        </div>
        <div class="form-group">
          <label for="newAppKey">{{'APP.KEY' | translate}}</label>
          <input class="form-control" id="newAppKey" ng-disabled="model.loading"
                 ng-model="model.app.key" type="text">
        </div>
        <div class="form-group">
          <label for="newAppDescription">{{'APP.DESCRIPTION' | translate}}</label>
          <textarea class="form-control" id="newAppDescription" ng-disabled="model.loading"
                    ng-model="model.app.description"
                    rows="5"></textarea>
        </div>
      </div>

      <div class="modal-footer">
        <div class="pull-right">
          <button class="btn btn-sm btn-default" ng-click="cancel()" ng-disabled="model.loading" type="button">
            {{'GENERAL.ACTION.CANCEL' | translate}}
          </button>
          <button class="btn btn-sm btn-default" ng-click="ok()"
                  ng-disabled="model.loading || !model.app.name || !model.app.key"
                  type="button">
            {{originalModel?'APP.ACTION.DUPLICATE-CONFIRM':'APP.ACTION.CREATE-CONFIRM' | translate}}
          </button>
        </div>
        <div class="loading pull-right" ng-show="model.loading">
          <div class="l1"></div>
          <div class="l2"></div>
          <div class="l2"></div>
        </div>
      </div>
    </div>
  </div>
</div>
